package com.punai.config.sqlitedao;

import cn.hutool.core.map.MapUtil;
import com.punai.common.utils.sqlite.SqliteUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class VersionRepository {
	@Autowired
	private SqliteUtils sqliteUtils;

	public Integer findVersion() {
		Integer version=null;
		String sql="select * from version";
		Map<String, Object> map = sqliteUtils.unique(sql);
		if(MapUtil.isNotEmpty(map)){
			version=Integer.parseInt(map.get("VERSION").toString());
		}
		return version;
	}
}
